package com.zaoniao.enstudy.infrastructure.convert;

import com.zaoniao.enstudy.domain.entity.Vocabulary;
import com.zaoniao.enstudy.infracore.web.PagedGridResult;
import com.zaoniao.enstudy.infrastructure.po.UserVocabularyPo;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 词汇表对象转换器.
 *
 * @author llb
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface UserVocabularyCrt {

    UserVocabularyCrt INSTANCE = Mappers.getMapper(UserVocabularyCrt.class);

    /**
     * do2po
     *
     * @param vocabulary 词汇表业务实体类
     * @return 词汇表数据库实体类
     */
    UserVocabularyPo do2po(Vocabulary vocabulary);

    /**
     * po2do
     *
     * @param vocabulary 词汇表数据库实体类
     * @return 词汇表业务实体类
     */
    Vocabulary po2do(UserVocabularyPo vocabulary);

    /**
     * po2doPage
     *
     * @param pagedGridResult po分页数据
     * @return do分页对象
     */
    PagedGridResult<Vocabulary> po2doPage(PagedGridResult<UserVocabularyPo> pagedGridResult);
}
